import turtle

def select():
    turtle.clear()
    turtle.up()
    turtle.goto(0,0)
    turtle.down()
    turtle.pencolor('black')
    turtle.setup(700, 550)
    turtle.bgpic('./bg.gif')
    turtle.write('[整数在python中是用什么表示的？]',
                 True, 'center', font=('Arial', 28, 'normal'))
    turtle.pu()
    turtle.goto(-150,-150)
    turtle.pd()
    turtle.write('A.int', True,'center',font=('Arial',20,'normal'))
    turtle.pu()
    turtle.goto(0,-150)
    turtle.pd()
    turtle.write('B.float', True,'center',font=('Arial',20,'normal'))
    turtle.pu()
    turtle.goto(150,-150)
    turtle.pd()
    turtle.write('C.str', True,'center',font=('Arial',20,'normal'))
def click(x, y):
    if y > -150 and y < -120:
        turtle.up()
        turtle.goto(0, -50)
        turtle.down()
        if x > -175 and x < -125:
            turtle.pencolor('green')
            turtle.write('回答正确', True, 'center', font=('Arial', 20, 'normal'))

        elif  x > -25 and x < 25:
            turtle.pencolor('red')
            turtle.write('回答错误', True, 'center', font=('Arial', 20, 'normal'))
        elif  x > 125 and x < 175:
            turtle.pencolor('red')
            turtle.write('回答错误', True, 'center', font=('Arial', 20, 'normal'))
        turtle.ontimer(select, 3000)


select()
turtle.onscreenclick(click)
turtle.done()
